package cn.hiapi.user.api;

import cn.hiapi.basic.ResponseEntity;
import cn.hiapi.basic.controller.BasicController;
import cn.hiapi.interfaces.DispatchContext;
import cn.hiapi.interfaces.config.IConfigService;
import cn.hiapi.shopkeeper.consts.AppConst;
import cn.hiapi.utils.JsonUtils;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author AdinZ
 * @date 2023/2/24 17:41
 */
@RestController
@RequestMapping("/user/lottery/share")
public class UserShareController extends BasicController {

    private final DispatchContext dispatchContext;

    public UserShareController(DispatchContext dispatchContext) {
        this.dispatchContext = dispatchContext;
    }

    @GetMapping("")
    public ResponseEntity share() {
//        JSONObject config = this.dispatchContext.getServiceOne(IConfigService.class).getConfig(AppConst.CONFIG_SHOPKEEPER_CONFIG);
//        //每天抽奖次数
//        int lottery_count = JsonUtils.getInt(config, "lottery_count", 0);
//        //分享获得抽奖次数
//        int share_lottery = JsonUtils.getInt(config, "share_lottery", 0);
//        //每天最多分享次数
//        int share_limit = JsonUtils.getInt(config, "share_limit", 1);
//
//        Token<Object> token = TokenGet.get();


        return null;

    }
}
